package com.zbl.zblproject.erp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zbl.zblproject.core.entity.Brand;
import com.zbl.zblproject.core.entity.Supplier;
import com.zbl.zblproject.core.utils.NumberUtil;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/8
 * <p>
 * ERP模块的产品类
 */
@TableName("zbl_goods")
public class ErpGoods {

    @TableId(type = IdType.AUTO)
    private int goodsId;

    /**
     * 分类ID
     */
    private int catId;

    /**
     * 条码号
     */
    private String goodsSn;
    /**
     * 报损数量
     */
    @TableField(exist = false)
    private int bsNumber;

    public int getBsNumber() {
        return bsNumber;
    }

    public void setBsNumber(int bsNumber) {
        this.bsNumber = bsNumber;
    }

    /**
     * 商品名称
     */
    private String goodsName;

    private String goodsNameStyle;

    private int clickCount;

    /**
     * 品牌ID
     */
    private int brandId;

    private String providerName;

    /**
     * 数量
     */
    private int goodsNumber;

    /**
     * 重量
     */
    private BigDecimal goodsWeight;

    /**
     * 市场价格
     */
    private BigDecimal marketPrice;

    /**
     * 批发价格
     */
    private BigDecimal shopPrice;

    private BigDecimal promotePrice;

    private int promoteStartDate;

    private int promoteEndDate;

    private int warnNumber;

    private String keywords;

    private int whId;//仓库id

    /**
     * 商品简介
     */
    private String goodsBrief;

    /**
     * 商品描述
     */
    private String goodsDesc;

    /**
     * 缩略图
     */
    private String goodsThumb;

    /**
     * 商品图片
     */
    private String goodsImg;

    /**
     * 图片
     */
    private String originalImg;

    private int isReal;

    private String extensionCode;

    private int isOnSale;

    private int isAloneSale;

    private int isShipping;

    private int integral;

    private int addTime;

    private int sortOrder;

    private int isDelete;

    private int isBest;

    private int isNew;

    private int isHot;

    private int isStore;

    private int isPromote;

    private int bonusTypeId;

    private int lastUpdate;

    private int goodsType;

    private String sellerNote;

    private int giveIntegral;

    private int rankIntegral;

    private int suppliersId;

    private int isCheck;

    /**
     * 地址
     */
    private String PAddress;

    /**
     * 拼音首字母
     */
    private String firstLetter;

    /**
     * 向厂家最小起订量
     */
    private int minimumQuantity;

    /**
     * 向门店最小起订量
     */
    private int minimumStore;

    /**
     * 小单位ID
     */
    @TableField("smallunit_id")
    private int smallunitId;


    /**
     * 推荐采购量
     */
    @TableField(exist = false)
    private Integer recommendPurchase;
    @TableField(exist = false)
    private int salesAmount;
    /**
     * 商品等级
     */
    private int goodsLevel;
    /**
     * 订货周期
     */
    private int orderCycle;
    /**
     * 超库存订购
     */
    private int overstockOrder;

    private String specifications;

    public Integer getRecommendPurchase() {
        return recommendPurchase;
    }

    public void setRecommendPurchase(Integer recommendPurchase) {
        this.recommendPurchase = recommendPurchase;
    }

    public int getSalesAmount() {
        return salesAmount;
    }

    public void setSalesAmount(int salesAmount) {
        this.salesAmount = salesAmount;
    }

    public int getOrderCycle() {
        return orderCycle;
    }

    public void setOrderCycle(int orderCycle) {
        this.orderCycle = orderCycle;
    }

    /**
     * 是否自定义
     */
    private int isCustom;


    /**
     * 折扣码
     */
    private double discount;

    /**
     * 状态
     * 0 启用  1 禁用
     */
    private int status;

    /**
     * 本月销量
     */
    private int soldNumberOfBeforeMonth;

    @TableField(exist = false)
    private String smallUnitName;

    /**
     * 牌子
     */
    @TableField(exist = false)
    private Brand erpBrand;

    /**
     * 分类
     */
    @TableField(exist = false)
    private ErpCategory erpCategory;

    /**
     * 供应商
     */
    @TableField(exist = false)
    private Supplier erpSupplier;

    /**
     * 可用库存
     */
    @TableField(exist = false)
    private int availableStock;

    @TableField(exist = false)
    @JSONField(serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private ErpWarehouse defaultWarehouse;


    /**
     * 所有的商品数量
     */
    @TableField(exist = false)
    private int allNum;

    @TableField(exist = false)
    private int stock;


    // private String storeName;

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getCatId() {
        return catId;
    }

    public void setCatId(int catId) {
        this.catId = catId;
    }

    public String getGoodsSn() {
        return goodsSn;
    }

    public void setGoodsSn(String goodsSn) {
        this.goodsSn = goodsSn;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsNameStyle() {
        return goodsNameStyle;
    }

    public void setGoodsNameStyle(String goodsNameStyle) {
        this.goodsNameStyle = goodsNameStyle;
    }

    public int getClickCount() {
        return clickCount;
    }

    public void setClickCount(int clickCount) {
        this.clickCount = clickCount;
    }

    public int getBrandId() {
        return brandId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public int getGoodsNumber() {
        return goodsNumber;
    }

    public void setGoodsNumber(int goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    public BigDecimal getGoodsWeight() {
        return goodsWeight;
    }

    public void setGoodsWeight(BigDecimal goodsWeight) {
        this.goodsWeight = goodsWeight;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public BigDecimal getShopPrice() {
        return shopPrice;
    }

    public void setShopPrice(BigDecimal shopPrice) {
        this.shopPrice = shopPrice;
    }

    public BigDecimal getPromotePrice() {
        return promotePrice;
    }

    public void setPromotePrice(BigDecimal promotePrice) {
        this.promotePrice = promotePrice;
    }

    public int getPromoteStartDate() {
        return promoteStartDate;
    }

    public void setPromoteStartDate(int promoteStartDate) {
        this.promoteStartDate = promoteStartDate;
    }

    public int getPromoteEndDate() {
        return promoteEndDate;
    }

    public void setPromoteEndDate(int promoteEndDate) {
        this.promoteEndDate = promoteEndDate;
    }

    public int getWarnNumber() {
        return warnNumber;
    }

    public void setWarnNumber(int warnNumber) {
        this.warnNumber = warnNumber;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getGoodsBrief() {
        return goodsBrief;
    }

    public void setGoodsBrief(String goodsBrief) {
        this.goodsBrief = goodsBrief;
    }

    public String getGoodsDesc() {
        return goodsDesc;
    }

    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }

    public String getGoodsThumb() {
        return goodsThumb;
    }

    public void setGoodsThumb(String goodsThumb) {
        this.goodsThumb = goodsThumb;
    }

    public String getGoodsImg() {
        return goodsImg;
    }

    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
    }

    public String getOriginalImg() {
        return originalImg;
    }

    public void setOriginalImg(String originalImg) {
        this.originalImg = originalImg;
    }

    public int getIsReal() {
        return isReal;
    }

    public void setIsReal(int isReal) {
        this.isReal = isReal;
    }

    public String getExtensionCode() {
        return extensionCode;
    }

    public void setExtensionCode(String extensionCode) {
        this.extensionCode = extensionCode;
    }

    public int getIsOnSale() {
        return isOnSale;
    }

    public void setIsOnSale(int isOnSale) {
        this.isOnSale = isOnSale;
    }

    public int getIsAloneSale() {
        return isAloneSale;
    }

    public void setIsAloneSale(int isAloneSale) {
        this.isAloneSale = isAloneSale;
    }

    public int getIsShipping() {
        return isShipping;
    }

    public void setIsShipping(int isShipping) {
        this.isShipping = isShipping;
    }

    public int getIntegral() {
        return integral;
    }

    public void setIntegral(int integral) {
        this.integral = integral;
    }

    public int getAddTime() {
        return addTime;
    }

    public void setAddTime(int addTime) {
        this.addTime = addTime;
    }

    public int getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(int sortOrder) {
        this.sortOrder = sortOrder;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public int getIsBest() {
        return isBest;
    }

    public void setIsBest(int isBest) {
        this.isBest = isBest;
    }

    public int getIsNew() {
        return isNew;
    }

    public void setIsNew(int isNew) {
        this.isNew = isNew;
    }

    public int getIsHot() {
        return isHot;
    }

    public void setIsHot(int isHot) {
        this.isHot = isHot;
    }

    public int getIsStore() {
        return isStore;
    }

    public void setIsStore(int isStore) {
        this.isStore = isStore;
    }

    public int getIsPromote() {
        return isPromote;
    }

    public void setIsPromote(int isPromote) {
        this.isPromote = isPromote;
    }

    public int getBonusTypeId() {
        return bonusTypeId;
    }

    public void setBonusTypeId(int bonusTypeId) {
        this.bonusTypeId = bonusTypeId;
    }

    public int getLastUpdate() {
        return lastUpdate;
    }

    public void setLastUpdate(int lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    public int getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }

    public String getSellerNote() {
        return sellerNote;
    }

    public void setSellerNote(String sellerNote) {
        this.sellerNote = sellerNote;
    }

    public int getGiveIntegral() {
        return giveIntegral;
    }

    public void setGiveIntegral(int giveIntegral) {
        this.giveIntegral = giveIntegral;
    }

    public int getRankIntegral() {
        return rankIntegral;
    }

    public void setRankIntegral(int rankIntegral) {
        this.rankIntegral = rankIntegral;
    }

    public int getSuppliersId() {
        return suppliersId;
    }

    public void setSuppliersId(int suppliersId) {
        this.suppliersId = suppliersId;
    }

    public int getIsCheck() {
        return isCheck;
    }

    public void setIsCheck(int isCheck) {
        this.isCheck = isCheck;
    }

    public String getPAddress() {
        return PAddress;
    }

    public void setPAddress(String PAddress) {
        this.PAddress = PAddress;
    }

    public Brand getErpBrand() {
        return erpBrand;
    }

    public void setErpBrand(Brand erpBrand) {
        this.erpBrand = erpBrand;
    }

    public ErpCategory getErpCategory() {
        return erpCategory;
    }

    public void setErpCategory(ErpCategory erpCategory) {
        this.erpCategory = erpCategory;
    }

    public Supplier getErpSupplier() {
        return erpSupplier;
    }

    public void setErpSupplier(Supplier erpSupplier) {
        this.erpSupplier = erpSupplier;
    }

    public int getAvailableStock() {
        return availableStock;
    }

    public void setAvailableStock(int availableStock) {
        this.availableStock = availableStock;
    }


    public String getFirstLetter() {
        return firstLetter;
    }

    public void setFirstLetter(String firstLetter) {
        this.firstLetter = firstLetter;
    }

    public int getMinimumQuantity() {
        return minimumQuantity;
    }

    public void setMinimumQuantity(int minimumQuantity) {
        this.minimumQuantity = minimumQuantity;
    }

    public int getMinimumStore() {
        return minimumStore;
    }

    public void setMinimumStore(int minimumStore) {
        this.minimumStore = minimumStore;
    }

    public int getSmallunitId() {
        return smallunitId;
    }

    public void setSmallunitId(int smallunitId) {
        this.smallunitId = smallunitId;
    }

    public int getGoodsLevel() {
        return goodsLevel;
    }

    public void setGoodsLevel(int goodsLevel) {
        this.goodsLevel = goodsLevel;
    }

    public int getOverstockOrder() {
        return overstockOrder;
    }

    public void setOverstockOrder(int overstockOrder) {
        this.overstockOrder = overstockOrder;
    }


    public String getSpecifications() {
        return specifications;
    }

    public void setSpecifications(String specifications) {
        this.specifications = specifications;
    }


    public int getIsCustom() {
        return isCustom;
    }

    public void setIsCustom(int isCustom) {
        this.isCustom = isCustom;
    }


    public double getDiscount() {
        return discount;
    }

    public void setDiscount(double discount) {
        this.discount = discount;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getSmallUnitName() {
        return smallUnitName;
    }

    public void setSmallUnitName(String smallUnitName) {
        this.smallUnitName = smallUnitName;
    }

    public int getNumberUnit() {
        return NumberUtil.computer(this.specifications);
    }

    public ErpWarehouse getDefaultWarehouse() {
        return defaultWarehouse;
    }

    public void setDefaultWarehouse(ErpWarehouse defaultWarehouse) {
        this.defaultWarehouse = defaultWarehouse;
    }

    public int getAllNum() {
        return allNum;
    }

    public void setAllNum(int allNum) {
        this.allNum = allNum;
    }


    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public int getSoldNumberOfBeforeMonth() {
        return soldNumberOfBeforeMonth;
    }

    public void setSoldNumberOfBeforeMonth(int soldNumberOfBeforeMonth) {
        this.soldNumberOfBeforeMonth = soldNumberOfBeforeMonth;
    }

//    public String getStoreName() {
//        return storeName;
//    }
//
//    public void setStoreName(String storeName) {
//        this.storeName = storeName;
//    }

    @Override
    public String toString() {
        return "ErpGoods{" +
                "goodsId=" + goodsId +
                ", catId=" + catId +
                ", goodsSn='" + goodsSn + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", goodsNameStyle='" + goodsNameStyle + '\'' +
                ", clickCount=" + clickCount +
                ", brandId=" + brandId +
                ", providerName='" + providerName + '\'' +
                ", goodsNumber=" + goodsNumber +
                ", goodsWeight=" + goodsWeight +
                ", marketPrice=" + marketPrice +
                ", shopPrice=" + shopPrice +
                ", promotePrice=" + promotePrice +
                ", promoteStartDate=" + promoteStartDate +
                ", promoteEndDate=" + promoteEndDate +
                ", warnNumber=" + warnNumber +
                ", keywords='" + keywords + '\'' +
                ", goodsBrief='" + goodsBrief + '\'' +
                ", goodsDesc='" + goodsDesc + '\'' +
                ", goodsThumb='" + goodsThumb + '\'' +
                ", goodsImg='" + goodsImg + '\'' +
                ", originalImg='" + originalImg + '\'' +
                ", isReal=" + isReal +
                ", extensionCode='" + extensionCode + '\'' +
                ", isOnSale=" + isOnSale +
                ", isAloneSale=" + isAloneSale +
                ", isShipping=" + isShipping +
                ", integral=" + integral +
                ", addTime=" + addTime +
                ", sortOrder=" + sortOrder +
                ", isDelete=" + isDelete +
                ", isBest=" + isBest +
                ", isNew=" + isNew +
                ", isHot=" + isHot +
                ", isStore=" + isStore +
                ", isPromote=" + isPromote +
                ", bonusTypeId=" + bonusTypeId +
                ", lastUpdate=" + lastUpdate +
                ", goodsType=" + goodsType +
                ", sellerNote='" + sellerNote + '\'' +
                ", giveIntegral=" + giveIntegral +
                ", rankIntegral=" + rankIntegral +
                ", suppliersId=" + suppliersId +
                ", isCheck=" + isCheck +
                ", PAddress='" + PAddress + '\'' +
                ", firstLetter='" + firstLetter + '\'' +
                ", minimumQuantity=" + minimumQuantity +
                ", minimumStore=" + minimumStore +
                ", smallunitId=" + smallunitId +
                ", goodsLevel=" + goodsLevel +
                ", overstockOrder=" + overstockOrder +
                ", specifications='" + specifications + '\'' +
                ", isCustom=" + isCustom +
                ", discount=" + discount +
                ", status=" + status +
                ", smallUnitName='" + smallUnitName + '\'' +
                ", erpBrand=" + erpBrand +
                ", erpCategory=" + erpCategory +
                ", erpSupplier=" + erpSupplier +
                ", availableStock=" + availableStock +
                ", defaultWarehouse=" + defaultWarehouse +
                ", allNum=" + allNum +
                '}';
    }

    public int getWhId() {
        return whId;
    }

    public void setWhId(int whId) {
        this.whId = whId;
    }
}
